define(function(require){
	var $ = require("jquery");
	var justep = require("$UI/system/lib/justep");
    var page=1;
	var Model = function(){
		this.callParent();
	};
	var win="";
	var row="";
   //取消事件
     var quxiao=function(){
       $('#wxloading').css("display","none");
    }
    //请求列表数据
	Model.prototype.modelParamsReceive = function(event){
      zuoti = this.comp("zhuanjia");
         zuoti.clear();
         $.ajax({
               type: "GET",
               url: window.yuming+'/app/expertinfo/ten/'+page,     
               async: false,
               cache: false,
               success: function(datas){
                     // var obj = JSON.parse(datas);  
                      $.each(datas,function(i,n){
                      var zuotis = {
                      defaultValues : [
                         {
                           "id" :n.id,
                           "img" :window.imgshou+n.headerUrl,
                           "name" :n.nameMeng,
                           "leixing" :n.addressMeng,
                           "jieshao" :n.expertiseMeng,
                           "zhenduan":n.dealingProblems,
                           "zhuangtai":n.status,
                           "uid" :n.uid,
                           "xiang" :n.personalMeng
                         }
                        ]
                       };
                       zuoti.newData(zuotis);
                       })
                
       
               }
        })
	};
   //下拉刷新事件
	Model.prototype.scrollView1PullUp = function(event){
       /* page=page+10;
       zuoti = this.comp("zhuanjia");
         $.ajax({
               type: "GET",
               url: 'http://'+window.yuming+'/app/expertinfo/ten/'+page,     
               async: false,
               cache: false,
               success: function(datas){
                     // var obj = JSON.parse(datas);  
                   $.each(datas,function(i,n){
                      var zuotis = {
                      defaultValues : [
                        {
                          "id" :n.id,
                          "img" :'http://'+window.imgshou+n.headerUrl,
                          "name" :n.nameMeng,
                          "leixing" :n.addressMeng,
                          "jieshao" :n.expertiseMeng,
                          "zhenduan":n.dealingProblems,
                          "zhuangtai":n.status,
                          "uid" :n.uid,
                          "xiang" :n.personalMeng
                        }
                       ]
                      };
                       zuoti.newData(zuotis);
                       })
                
       
               }
        })*/
	};
   //点击跳转详情页面
	Model.prototype.mediaLeft1Click = function(event){
	   var rows=event.bindingContext.$object;
       this.comp("windowDialog1").open({
        params:{
              rowdata:rows.toJson()
        }     
       });
	};

	Model.prototype.button1Click = function(event){
	    win = this.comp("jindengtai");
	  //  localStorage.dengdai= this.comp("windowDialog3");
	    row=event.bindingContext.$object;
	    var uid=row.toJson().uid.value;
        this.shipin(uid,window.token);  	
	};
    Model.prototype.shipin=function(h,t){   
     $.ajax({
        type: "GET",
        url: window.yuming+'/videoconnects/vc/?eid='+h+'&login-token='+t+'&type='+window.menghan,     
        async: false,
        cache: false,
        success: function(datas){
        
              window.roomurl=datas.url+datas.roomid;
              
              window.roomid=datas.id;
              
              win.open({
              
                  params:{
                  
                     rowdata:row.toJson()
                     
                   } 
                       
               });
            
               // alert(datas.roomid);
               //alert(datas.roomid)
              // location.href=datas.url+datas.roomid;
            },
        error: function(XMLHttpRequest){  
        }
    });
    }
	Model.prototype.scrollView1PullDown = function(event){

	};
	Model.prototype.button3Click = function(event){ 
       var row=event.bindingContext.$object;
        // console.log(row.toJson())
       this.comp("wdEmptym").open({
        params:{
              rowdata:row.toJson()
        }     
       });  
	};
	
	return Model;
});